package com.bl.student.api;

import com.bl.student.service.ServiceConfig;
import com.spring4all.swagger.EnableSwagger2Doc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.*;

/**
 * Created by yujingyi on 2017/12/14.
 */
@SpringBootApplication(
        scanBasePackages={"com.bl.student.api"},
        exclude={DataSourceAutoConfiguration.class,
                HibernateJpaAutoConfiguration.class}
)
@Import({ServiceConfig.class})
@EnableSwagger2Doc
@ServletComponentScan
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

//    @Bean
//    @ConfigurationProperties("app.datasource.slave")
//    public DataSourceProperties slaveDataSourceProperties() {
//        return new DataSourceProperties();
//    }
//
//    @Bean
//    @ConfigurationProperties("app.datasource.slave")
//    public DataSource slaveDataSource() {
//        return slaveDataSourceProperties().initializeDataSourceBuilder().build();
//    }
}
